#include<iostream>
#include<string>
using namespace std;
class Solution {
public:
    string reverseStr(string s, int k) {
        int len = s.size();
        int cur = 0;
        for (int i = 0; i < len; i++) {
            if (i - cur == 2 * k) {
                reverse(s.begin() + cur, s.begin() + cur + k);
                cur = i;
            }
        }
        if (cur + k < len) {
            reverse(s.begin() + cur, s.begin() + cur + k);

        }
        else {
            reverse(s.begin() + cur, s.end());

        }
        return s;
    }
};
int main()
{
    return 0;
}